<h2>Quản lý hóa đơn</h2>

<form action="<?= $this->baseUrl('/admin/order/') ?>" name="frmSmall" id="frmSmall" method="get" class="frmSmall">
	<p>
		<label class="required" for="order_id">Mã hóa đơn:</label> 
		<input type="text" id="order_id" name="order_id" value="<?php echo $this->orderID ?>"/>
	</p>
	<p>
		<label class="required" for="fullname">Tên khách hàng:</label> 
		<input type="text" id="fullname" name="fullname" value="<?php echo $this->fullname ?>"/>
	</p>
	<!--  
	<p>
		<label class="required" for="date">Ngày mua hàng:</label> 
		<input type="text" id="date" name="date" value="<?php echo $this->date ?>"/>
	</p>
	-->
	<p class="btn">
		<input type="submit" value="Tìm kiếm" id="submit" name="submit">
	</p>
</form>

<div class="parameters">
    <table cellspacing="0" cellpadding="0" class="tbLarger">
        <tr>
            <th>Mã hóa đơn</th>
            <th width="350">Tên khách hàng</th>
			<th width="100" align="right">Giá trị</th>
			<th width="100" align="right">Ngày mua</th>
			<th width="100">&nbsp;</th>
        </tr>  
        <?php foreach($this->listOrders as $key => $order) { ?>
	    <tr <?php if( $key % 2 == 1 ) echo 'class="highlight"'; ?>>
			<td><?php echo $order['order_id']; ?></td>
			<td><?php echo $order['fullname']; ?></td>
			<td><?php echo $order['total']; ?></td>
			<td><?php if($order['date']) echo date_create_from_format( 'Y-m-d H:i:s', $order['date'] )->format('d/m/Y'); ?></td>
			<td><a href="<?php echo $this->baseUrl('/admin/order-detail/order_id/'.$order['order_id']); ?>">Chi tiết</a> | 
				<a href="<?php echo $this->baseUrl('/admin/order-delete/order_id/'.$order['order_id']); ?>" onclick="return confirm('Bạn có thật sự muốn xóa hay không ?');">Xóa</a>
				</td>
		</tr>
	    <?php } ?>
    </table>
</div>
        